﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace learnCsharpwinform
{
    public partial class IkineTestForm : Form
    {
        public IkineTestForm()
        {
            InitializeComponent();
        }
        public void ShowIkineNum(int num)
        {
            this.TB_SolutionNum.Text = num.ToString();
        }
        public void ShowDGV(double[,] solution)
        {
            DataTable dt = new DataTable();
            for (int i = 0; i < solution.GetLength(1); i++)
                dt.Columns.Add((i+1).ToString(), typeof(string));
            for (int i = 0; i < solution.GetLength(0); i++)
            {
                DataRow dr = dt.NewRow();
                for (int j = 0; j < solution.GetLength(1); j++)
                    dr[j] = solution[i, j].ToString();
                dt.Rows.Add(dr);
            }
            this.DGV_Solution.DataSource = dt;
            DGV_Solution.AutoResizeColumns();
        }
    }
}
